<template>
  <div class="detail">
    <div class="header">
      <h1 class="hh1">详情页面</h1>
    </div>
    <div class="img-div">
      <img
        class="img"
        :src="imgUrl"
        alt
      />
    </div>
    <div class="p1-div d">
      <el-tag type="danger" class="p1 p">{{title}} </el-tag>
    </div>
    <div class="p2-div d">
      <el-tag type="info" class="p2 p">{{desc}} </el-tag>
    </div>
    <div class="p3-div d">
      <el-tag type="success" class="p3 p" @click="p3Click">返回</el-tag>
    </div>
  </div>
</template>

<script scoped>
export default {
  name: "Detail",
  data(){
      return{
          imgUrl:this.$route.query.imgUrl,
          desc:this.$route.query.desc,
          title:this.$route.query.title
      }
  },
  mounted(){
      console.log(this.imgUrl)
  },
  methods:{
      p3Click(){
          this.$router.push('/home')
      }
  }
};
</script>

<style scoped>
.header {
  background: #00bcd4;
  height: 0.5rem;
  display: flex;
  justify-content: center;
  align-items: center;
}
.hh1 {
  color: #fff;
  font-size: 0.25rem;
}
.img-div {
  padding: 0.1rem;
  background: #ccc;
}
.img {
  width: 100%;
  height: 2rem;
}
.d{
    padding: .05rem;
}
.p1{
    font-size: .25rem;
}
.p2{
    font-size: .2rem;
}
.p{
    width: 100%;
}
.p3-div{
    padding-top: .5rem;
}
.p3{
    font-size: .25rem;
    text-align: center;
}
</style>